{% extends "base.html" %}
{% load i18n %}

{% block main_content %}

<h2>{{ document.filename }}</h2>

<div class="manage_doc">
	<a href="{% url documents-new-version document.id %}" class="doc_new_ver">{% trans "Add new version" %}</a>
	<a href="{% url documents-change document.id %}" class="doc_change">{% trans "Change details" %}</a>
	<a href="{% url documents-delete document.id %}" class="doc_delete">{% trans "Delete" %}</a>
</div>

<table class="data">
	<tr>
		<th>{% trans "File name" %}</th>
		<td>{{ document.filename }} <a href="{% url documents-file document.filename %}">{% trans "Download" %}</a></td>
	</tr>
	<tr>
		<th>{% trans "Category" %}</th>
		<td>{{ document.category }}</td>
	</tr>
	<tr>
		<th>{% trans "Author" %}</th>
		<td>{{ document.author }}</td>
	</tr>
	<tr>
		<th>{% trans "Beneficient" %}</th>
		<td>{{ document.beneficient }}</td>
	</tr>
	<tr>
		<th>{% trans "Issued on" %}</th>
		<td>{{ document.issued_on }}</td>
	</tr>
	<tr>
		<th>{% trans "Description" %}</th>
		<td>{{ document.description }}</td>
	</tr>
	<tr>
		<th>{% trans "Public" %}</th>
		<td>{% if document.public %}Yes{% else %}No{% endif %}</td>
	</tr>
	<tr>
		<th>{% trans "Versions" %}</th>
		<td>
			{% for ver in document.versions.all %}
				<a href="{% url documents-file-version document.filename,ver.version %}"><strong>{{ ver.version }}</strong> ({{ ver.timestamp|date:"Y-m-d H:i" }})</a><br>
			{% endfor %}
		</td>
	</tr>
</table>

{% endblock %}